import {
	defineConfig
} from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import ENV_CONFIG from "./config/envConfig.js";
import {
	resolve
} from "path"; // 导入 path 模块，帮助我们解析路径
// console.log(process.env,'--process-env')
export default defineConfig(() => {
	return {
		server: {
			port: "5273",
		},
		devServer: {
			proxy: {
				'/api': {
					target: 'http://192.168.1.17:8001/manage-system-api',
					changeOrigin: true,
					headers: {
						'X-Requested-With': 'XMLHttpRequest'
					}
				}
			}
		},
		resolve: {
			alias: {
				"@": resolve(__dirname, "/src"),
			},
		},
		plugins: [uni()],
		define: {
			"process.env.config": ENV_CONFIG, //配置一
			'process.env': process.env, //配置二
		},
	};
});